package com.service.imp;

import com.mapper.Zixunshi_lfyMapper;
import com.pojo.Adept_lfy;
import com.pojo.Fee_lfy;
import com.pojo.Grade_lfy;
import com.pojo.Zixunshi_lfy;
import com.service.Zixunshi_lfyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@Service
public class Zixunshi_lfyServiceImpl implements Zixunshi_lfyService {
    @Autowired
    private Zixunshi_lfyMapper zMapper;
    @Override
    public List<Zixunshi_lfy> selectName(Integer limit) {
        return zMapper.selectName(limit);
    }

    @Override
    public Zixunshi_lfy selectCityByName(Integer id) {
        return zMapper.selectCityByName(id);
    }

    @Override
    public List<Zixunshi_lfy> selectAdept(Integer id) {
        return zMapper.selectAdept(id);
    }

    @Override
    public List<Zixunshi_lfy> selectAll(String gradeName) {
        return zMapper.selectAll(gradeName);
    }

    @Override
    public List<Zixunshi_lfy> selectAll1(String gradeName, String address, String sex, List<String> type, List<String> adeptName) {
        List<Zixunshi_lfy> list=new ArrayList<>();
        List<Zixunshi_lfy> list1=zMapper.selectAll1(gradeName,address,sex,type,adeptName);
        HashSet<Zixunshi_lfy> unique=new HashSet<>(list1);
        list.addAll(unique);
        return list1;
    }

    @Override
    public List<Zixunshi_lfy> searchAll() {
        return zMapper.searchAll();
    }

    @Override
    public List<Zixunshi_lfy> selectAllByName(String zixunshiName) {
        return zMapper.selectAllByName(zixunshiName);
    }

    @Override
    public Integer delete(Integer zixunshiId) {
        return zMapper.delete(zixunshiId);
    }

    @Override
    public Integer insertInfo(Zixunshi_lfy zixunshi_lfy) {
        return zMapper.insertInfo(zixunshi_lfy.getZixunshiName(),zixunshi_lfy.getZixunshiGid(),
                zixunshi_lfy.getZixunshiSex(),
                zixunshi_lfy.getZixunshiAddress(),
                zixunshi_lfy.getZixunshiIntroduce());
    }

    @Override
    public Integer updateInfo(Zixunshi_lfy zixunshi_lfy) {
        return zMapper.updateInfo(zixunshi_lfy.getZixunshiName(),zixunshi_lfy.getZixunshiGid(),
                zixunshi_lfy.getZixunshiSex(), zixunshi_lfy.getZixunshiAddress(), zixunshi_lfy.getZixunshiIntroduce()
                , zixunshi_lfy.getZixunshiDel(), zixunshi_lfy.getZixunshiId());
    }


}
